/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package upc.jfactory.scp.jpa.bean;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
/**
 *
 * @author Diego
 */
@Entity
@Table(name = "Contratacion", catalog = "DAEPIFS_DB", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Contratacion.findAll", query = "SELECT c FROM Contratacion c"),
    @NamedQuery(name = "Contratacion.findByContratacionId", query = "SELECT c FROM Contratacion c WHERE c.contratacionId = :contratacionId"),
    @NamedQuery(name = "Contratacion.findByOfertaempresaId", query = "SELECT c FROM Contratacion c WHERE c.ofertaempresaId = :ofertaempresaId"),
    @NamedQuery(name = "Contratacion.findByPostulanteId", query = "SELECT c FROM Contratacion c WHERE c.postulanteId = :postulanteId"),
    @NamedQuery(name = "Contratacion.findByFechaInicio", query = "SELECT c FROM Contratacion c WHERE c.fechaInicio = :fechaInicio"),
    @NamedQuery(name = "Contratacion.findByFechaFin", query = "SELECT c FROM Contratacion c WHERE c.fechaFin = :fechaFin")})
public class Contratacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "contratacion_id", nullable = false)
    private Integer contratacionId;
    @Basic(optional = false)
    @Column(name = "ofertaempresa_id", nullable = false)
    private int ofertaempresaId;
    @Column(name = "postulante_id")
    private Integer postulanteId;
    @Column(name = "fecha_inicio", length = 10)
    private String fechaInicio;
    @Column(name = "fecha_fin", length = 10)
    private String fechaFin;

    public Contratacion() {
    }

    public Contratacion(Integer contratacionId) {
        this.contratacionId = contratacionId;
    }

    public Contratacion(Integer contratacionId, int ofertaempresaId) {
        this.contratacionId = contratacionId;
        this.ofertaempresaId = ofertaempresaId;
    }

    public Integer getContratacionId() {
        return contratacionId;
    }

    public void setContratacionId(Integer contratacionId) {
        this.contratacionId = contratacionId;
    }

    public int getOfertaempresaId() {
        return ofertaempresaId;
    }

    public void setOfertaempresaId(int ofertaempresaId) {
        this.ofertaempresaId = ofertaempresaId;
    }

    public Integer getPostulanteId() {
        return postulanteId;
    }

    public void setPostulanteId(Integer postulanteId) {
        this.postulanteId = postulanteId;
    }

    public String getFechaInicio() {
        return fechaInicio;
    }

    public void setFechaInicio(String fechaInicio) {
        this.fechaInicio = fechaInicio;
    }

    public String getFechaFin() {
        return fechaFin;
    }

    public void setFechaFin(String fechaFin) {
        this.fechaFin = fechaFin;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (contratacionId != null ? contratacionId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contratacion)) {
            return false;
        }
        Contratacion other = (Contratacion) object;
        if ((this.contratacionId == null && other.contratacionId != null) || (this.contratacionId != null && !this.contratacionId.equals(other.contratacionId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "upc.jfactory.scp.jpa.bean.Contratacion[contratacionId=" + contratacionId + "]";
    }

}
